package com.starhub.api.sys.user.result;

import com.starhub.api.sys.user.dto.SysUserDto;

import lombok.Data;

/**
 * 用户信息结果
 */
@Data
public class UserInfoResult {

    private Long id;

    private String avatar;

    private String name;

    private SysUserDto sysUser;

    /**
     * 构建成功结果
     */
    public static UserInfoResult success(SysUserDto sysUser) {
        UserInfoResult result = new UserInfoResult();
        result.setId(sysUser.getId());
        result.setAvatar(sysUser.getAvatar());
        result.setName(sysUser.getName());
        result.setSysUser(sysUser);
        return result;
    }
    
    /**
     * 构建失败结果
     */
    public static UserInfoResult fail() {
        return new UserInfoResult();
    }
}
